<?php
/**
 * 定义首页模型类
 * User: mrlifang
 * Date: 17/5/4
 * Time: 下午3:02
 */

namespace Home\Model;
use \PDO;
use \Frame\Libs\BaseModel;

final class IndexModel extends BaseModel
{

    //获取多行数据
    public function fetchAll(){
        //构建查询的SQL语句
        $sql = "SELECT * FROM student order by id";
        //执行SQL 返回二维数组
        $arr = $this->pdo->fetchAll($sql);
        return $arr;
    }

    public function delete($id){
        $sql = "DELETE FROM student WHERE id = {$id}";
        return $this->pdo->exec($sql);
    }


}